/**********************************
 ***	Imports
 **********************************/
package fr.montreuil.wargame.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

/**********************************
 *** 	@jgay
 *** 	@30 avr. 2012
 **********************************/
@Entity(name="batiment")
public class Batiment {
	/**********************************
	 ***	Variables
	 **********************************/
	@Id
	@GeneratedValue
	private Long id;
	
	private String name;
	private int lvl;
	
	private int costResources1;
	private int costResources2;
	private int costResources3;
	private int costResources4;
	
	private int interestResources1;
	private int interestResources2;
	private int interestResources3;
	private int interestResources4;
	
	@ManyToMany(fetch=FetchType.LAZY)
	private List<Batiment> batRequire;
	@ManyToMany(fetch=FetchType.LAZY)
	private List<Technologie> tecRequire;
	/**********************************
	 ***	Constructeur
	 **********************************/
	public Batiment(){}
	
	public Batiment(Long id, String name, int lvl, int costResources1,
			int costResources2, int costResources3, int costResources4,
			int interestResources1, int interestResources2,
			int interestResources3, int interestResources4,
			List<Batiment> batRequire, List<Technologie> tecRequire) {
		this.id = id;
		this.name = name;
		this.lvl = lvl;
		this.costResources1 = costResources1;
		this.costResources2 = costResources2;
		this.costResources3 = costResources3;
		this.costResources4 = costResources4;
		this.interestResources1 = interestResources1;
		this.interestResources2 = interestResources2;
		this.interestResources3 = interestResources3;
		this.interestResources4 = interestResources4;
		this.batRequire = batRequire;
		this.tecRequire = tecRequire;
	}


	/**********************************
	 ***	Méthodes
	 **********************************/
	public String afficheListe(){
		return this.name + " LV." + this.lvl;
	}
	
	/**********************************
	 ***	Getters / Setters
	 **********************************/
	public int getCostResources1() {
		return costResources1;
	}
	public void setCostResources1(int costResources1) {
		this.costResources1 = costResources1;
	}
	public int getCostResources2() {
		return costResources2;
	}
	public void setCostResources2(int costResources2) {
		this.costResources2 = costResources2;
	}
	public int getCostResources3() {
		return costResources3;
	}
	public void setCostResources3(int costResources3) {
		this.costResources3 = costResources3;
	}
	public int getCostResources4() {
		return costResources4;
	}
	public void setCostResources4(int costResources4) {
		this.costResources4 = costResources4;
	}
	public int getInterestResources1() {
		return interestResources1;
	}
	public void setInterestResources1(int interestResources1) {
		this.interestResources1 = interestResources1;
	}
	public int getInterestResources2() {
		return interestResources2;
	}
	public void setInterestResources2(int interestResources2) {
		this.interestResources2 = interestResources2;
	}
	public int getInterestResources3() {
		return interestResources3;
	}
	public void setInterestResources3(int interestResources3) {
		this.interestResources3 = interestResources3;
	}
	public int getInterestResources4() {
		return interestResources4;
	}
	public void setInterestResources4(int interestResources4) {
		this.interestResources4 = interestResources4;
	}
	public List<Batiment> getBatRequire() {
		return batRequire;
	}
	public void setBatRequire(List<Batiment> batRequire) {
		this.batRequire = batRequire;
	}
	public List<Technologie> getTecRequire() {
		return tecRequire;
	}
	public void setTecRequire(List<Technologie> tecRequire) {
		this.tecRequire = tecRequire;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getLvl() {
		return lvl;
	}

	public void setLvl(int lvl) {
		this.lvl = lvl;
	}
	
}
